package com.fjeld.middleware.activemq;

import com.fjeld.swingx.ColorConstants;

import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: fjeld
 * Date: 29/12/2011
 * Time: 11:19
 *
 * Transparent cell renderer
 */
public class MessagesCellRenderer  extends JLabel implements TableCellRenderer
{
    public MessagesCellRenderer()
    {
        setBackground(ColorConstants.BLUE_HIGHLIGHT);
        setOpaque(false);
        setForeground(ColorConstants.TEXT_NORMAL);
    }

    public Component getTableCellRendererComponent(JTable jTable, Object value,
                                                   boolean isSelected, boolean hasFocus, int row, int column)
    {
        String text = null != value ? value.toString() : "";
        setText(text);
        return this;
    }
}
